﻿using System;
using Jayden.Dll.Web.HtmlControls.Descriptions;
using Jayden.Dll.Web.HtmlControls.Generics;
using Jayden.Dll.Web.HtmlControls.Interfaces;

namespace Jayden.Dll.Web.HtmlControls
{
	public class Object : HtmlElement, WithName, WithType, WithHeight, WithWidth, WithForm
	{
		public Object() : base(ObjectDescription.Instance) { }

		public string Name { get { return this["name"]; } set { this["name"] = value; } }
		public string Data { get { return this["data"]; } set { this["data"] = value; } }
		public string Type { get { return this["type"]; } set { this["type"] = value; } }
		public uint? Height { get { return GetAttributeUint("height"); } set { SetAttribute("height", value); } }
		public uint? Width { get { return GetAttributeUint("width"); } set { SetAttribute("width", value); } }
		public string UseMap { get { return this["usemap"]; } set { this["usemap"] = value; } }
		public string Form { get { return this["form"]; } set { this["form"] = value; } }
	}
	public class ObjectDescription : HtmlElementDescription
	{
		public static readonly ObjectDescription Instance = new ObjectDescription();
		private ObjectDescription() : base("object") { }
		public override Type ControlType { get { return typeof(Object); } }
		public override string Description { get { return "external content."; } }
		public override bool IsFlowElement { get { return true; }  }
		public override bool IsPhrasingElement { get { return true; } }
	}
}
